const RateModel = require("../../models/RateModel")
// const Email = require("../../email/email")
const { sendMail } = require("../../email/email");

const RateService ={
    webgetList:async(data)=>{
        return RateModel.find({building:data[0],roomnumber:data.substring(1,4),ispay:0},["propname","propnumber","propemail","building","roomnumber","tmoney","editTime","ispay"])
    },
    webgetallList:async(data)=>{
        return RateModel.find({building:data[0],roomnumber:data.substring(1,4)},["propname","propnumber","propemail","building","roomnumber","tmoney","editTime","ispay"])
    },
    changeispay:async({_id})=>{
        return RateModel.updateOne({_id},{ispay:1})
    },
}

module.exports =RateService
